package com.weiz.designpatterns.composite;

import java.util.List;

/**
 * 部门类
 * @author weiz
 *
 */
public class Department extends Basic {
    /**
     * 本部门包含的员工或者子部门
     */
    private List<Basic> list;

    @Override
    int getSumOfStaff(int sum) {
        for(Basic basic:list){
            sum=basic.getSumOfStaff(sum);
        }
        return sum;
    }

    public List<Basic> getList() {
        return list;
    }

    public void setList(List<Basic> list) {
        this.list = list;
    }
}